Hi Manoj Bhatt, To read XML file in PHP, you can use the following code:
// Create DOMDocument object $xmlDoc = new DOMDocument(); // load XML file $xmlDoc->load("YourFile.xml"); $ptag = $xmlDoc->getElementsByTagName('ParentNode'); $childQType=$ptag->item($i)->getElementsByTagName('ChildNode'); echo $childQType->item(0)->childNodes->item(0)->nodeValue;
So in the same manner you can get all nodes values.
Liked By
Write Answer
How to read xml file in PHP
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
01-Dec-2011To read XML file in PHP, you can use the following code:
So in the same manner you can get all nodes values.